package model.surface;

import java.util.ArrayList;
import java.util.List;
import android.graphics.Bitmap;

/**
 * Class for representing the current level
 * which is played by the player.
 * The information for the class is given by enum Levels. 
 * 
 * @author EvilTeam
 *
 */
public class Map {

	private static Bitmap mapBackground;
	private static List<PathPoint> pathArray = new ArrayList<PathPoint>();
	private static float pathWidth;

	private static Map map = null;

	private Map() {
	}

	public static void mapFactory(Bitmap mapBackground,
			List<PathPoint> pathArray, float pathWidth) {
		if (map == null) {
			setMapBackground(mapBackground);
			setPath(pathArray);
			Map.setPathWidth(pathWidth);
			map = new Map();
		}
	}

	/**
	 * Cleans map instance.
	 */
	public static void cleanMap(){
		map = null;
	}
	
	public static Bitmap getMapBackground() {
		return mapBackground;
	}

	public static void setMapBackground(Bitmap map) {
		if (map != null)
			Map.mapBackground = map;
	}

	public static List<PathPoint> getPath() {
		return pathArray;
	}

	public static void setPath(List<PathPoint> pathArray) {
		if (pathArray != null)
			Map.pathArray = pathArray;
	}

	public static float getPathWidth() {
		return pathWidth;
	}

	public static void setPathWidth(float pathWidth) {
		if (pathWidth > 0)
			Map.pathWidth = pathWidth;
	}
}
